# Complier
CC  := gcc
CPP := g++
AR  := ar

INC_DIR := -I ./inc
LIB_DIR := -L ./
LIBS := 

CFLAGS :=

# PROJECT
TARGET_RUN := run
TARGET_STATIC := libMYU.a
TARGET := $(TARGET_STATIC)


SRC_FILES 	= FileManager.c MyTime.c MyUtils.c
OBJS_FILES  = FileManager.o MyTime.o MyUtils.o

TEST_FILES  = Test.c 

CFLAGS += $(INC_DIR) $(LIB_DIR) $(LIBS)
#CFLAGS += -Wall -O2
# CFLAGS += -DLINUX


# 编译静态库
all: $(TARGET_STATIC)	
# 编译测试程序

test: $(TARGET_RUN)
$(TARGET_RUN): $(TEST_FILES) $(TARGET_STATIC)
	$(CC) $(CFLAGS) $^ -o $@

$(TARGET_STATIC): $(SRC_FILES)   
	$(CC) $(CFLAGS) -c $(SRC_FILES)
	$(AR) rcs $@ $(OBJS_FILES)

.PHONY: clean
clean:
	rm $(OBJS_FILES) $(TARGET_STATIC)

